import { createContext, useContext } from 'react'
import AppleStore from './AppleStore'
const appStore = new AppleStore()
const AppleStoreContext = createContext(appStore)

export const StoreProvider = ({children})=>{
  return <AppleStoreContext.Provider value={appStore}>
    {children}
  </AppleStoreContext.Provider>
}

export const useStore = ()=>{
  return useContext(AppleStoreContext)
}
